<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>generator函数</title>
  <script>
    function* findAll() {
      console.log('111');
      // ajax => res
      let res = yield 1
      // res => 进行dom操作
      console.log(res);  // 100
      yield 2
      console.log('333');
      yield 3
    }
    let geo = findAll();
    console.log(geo.next());
    console.log(geo.next(100));
    // console.log(geo.next());
    // console.log(geo.next());
  </script>
</head>
<body>
  
</body>
</html>